#ifndef FunC_h
#define FunC_h
#define SCREEN_WIDTH ([UIScreen mainScreen].bounds.size.width)
#define SCREEN_HEIGHT ([UIScreen mainScreen].bounds.size.height)
#define SCREEN_MAX_LENGTH (MAX(SCREEN_WIDTH, SCREEN_HEIGHT))
//#define SCREEN_MIN_LENGTH (MIN(320,MIN(SCREEN_WIDTH, SCREEN_HEIGHT)))
#define SCREEN_MIN_LENGTH (MIN(SCREEN_WIDTH, SCREEN_HEIGHT))

#define STATUS_HEIGHT [[UIApplication sharedApplication] statusBarFrame].size.height
#define IS_PHONE ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone)
#define SCALE_WIDTH ([UIScreen mainScreen].bounds.size.width)/320.0
#define SCALE_HEIGHT ([UIScreen mainScreen].bounds.size.height)/568.0
#define AUTO(x) ((SCALE_WIDTH>SCALE_HEIGHT)?(SCALE_HEIGHT*(x)):(SCALE_WIDTH*(x)))
#define AL(x) x
#define THEME_COLOR ColorHex(0x952D69)
#define THEME_BUTTON_COLOR ColorHex(0x187E3C)
#define RED_COLOR ColorHex(0xf4333c)
#define SKY_BLUE_COLOR ColorHex(0x179ffe)
#define ORANGE_COLOR ColorHex(0xff5b05)
#define BLUE_COLOR RGBA(152,253,255,1.0)
#define LINE_COLOR ColorHex(0xf5f5f9)
#define CELL_LINE_COLOR RGBA(230, 230, 230, 1) 
#define TEXT_BLACK_COLOR ColorHex(0x333333)
#define TEXT_GRAY_COLOR ColorHex(0x888888)
#define RGBA(r,g,b,a) [UIColor colorWithRed:(r) / 255.0 green:(g) / 255.0 blue:(b) / 255.0 alpha:a]
#define ColorHex(s) [UIColor colorWithRed:(((s & 0xFF0000) >> 16))/255.0 green:(((s &0xFF00) >>8))/255.0 blue:((s &0xFF))/255.0 alpha:1.0]
#define FONT(X,a) [UIFont systemFontOfSize:(a) weight:(X)]
#define WS(type) __weak __typeof(&*type)weakSelf = type;
#define PT(px) (px)/2.0
#ifdef DEBUG
#define DeLog(fmt, ...) NSLog((@"%s \n[第%d行] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)
#else
# define DeLog(...)
#endif
#define iOS7Later ([UIDevice currentDevice].systemVersion.floatValue >= 7.0f)
#define iOS8Later ([UIDevice currentDevice].systemVersion.floatValue >= 8.0f)
#define iOS9Later ([UIDevice currentDevice].systemVersion.floatValue >= 9.0f)
#define iOS9_1Later ([UIDevice currentDevice].systemVersion.floatValue >= 9.1f)
#define iOS10Later ([UIDevice currentDevice].systemVersion.floatValue >= 10.0f)
#define IS_IPHONE (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
#define IS_IPAD (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
#define IS_IPHONE_4_OR_LESS (IS_IPHONE && SCREEN_MAX_LENGTH < 568.0)
#define IS_IPHONE_5_ (IS_IPHONE && SCREEN_MAX_LENGTH == 568.0)
#define IS_IPHONE_6_7 (IS_IPHONE && SCREEN_MAX_LENGTH == 667.0)
#define IS_IPHONE_6P_7P (IS_IPHONE && SCREEN_MAX_LENGTH == 736.0)
#endif 
